From 00a7df104c5d781db99d04dcb7ff72e31cc4dd27 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 2 Nov 2006 19:15:48 +0000 Subject: [PATCH] Allow elapsed time to go negative so that NMEA line reader can detect timeouts correctly. --- gbser_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gbser_posix.c b/gbser_posix.c index afbc5ba66..6e398c13f 100644 --- a/gbser_posix.c +++ b/gbser_posix.c @@ -404,8 +404,9 @@ int gbser_read_line(void *handle, void *buf, get_time(&tv); bp[pos] = '\0'; for (;;) { - unsigned time_left = ms - elapsed(&tv); + signed time_left = ms - elapsed(&tv); int c; + if (time_left <= 0) { return gbser_TIMEOUT; } -- 2.30.2